package com.zhentao.controller;


import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.impl.CdzGiftServiceImpl;
import com.zhentao.service.impl.CdzWinningRecordingServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 奖品表 前端控制器
 * </p>
 *
 * @author mp
 * @since 2024-12-27
 */
@RestController
@RequestMapping("/auth/cdz/gift")
public class CdzGiftController {
    @Autowired
    private CdzGiftServiceImpl cdzGiftService;

    @Autowired
    private CdzWinningRecordingServiceImpl cdzWinningRecordingService;
    @GetMapping("/list")
    public ResponseResult list() {
        return ResponseResult.okResult(cdzGiftService.list());
    }

    @PostMapping("/add")
    /**
     * @description:添加中将记录
     * @author: muhaoyang
     * @date: 2024/12/28 9:43
     * @param: [gitfId]
     * @return: com.zhentao.model.common.dtos.ResponseResult
     **/
    public ResponseResult add(@RequestParam("prizeId")Integer gitfId ){
        return cdzWinningRecordingService.add(gitfId);
    }

    @GetMapping("/selectWinn")
    /**
     * @description:查询中奖记录
     * @author: muhaoyang
     * @date: 2024/12/28 9:43
     * @param: []
     * @return: com.zhentao.model.common.dtos.ResponseResult
     **/
    public ResponseResult selectWinn(){
        return cdzGiftService.selectWinn();
    }

    @PostMapping("/updateStatus")
    /**
     * @description:修改中奖记录状态
     * @author: muhaoyang
     * @date: 2024/12/28 9:43
     * @param: [giftNumber]
     * @return: com.zhentao.model.common.dtos.ResponseResult
     **/
    public ResponseResult updateStatus(@RequestParam("giftNumber")Long giftNumber){
        return cdzWinningRecordingService.updateStatus(giftNumber);
    }

}

